Ad Widget

Collapse

Zabbix HTTP Agent API Call

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • marcas
    Junior Member
    • Jun 2019
    • 2

    #1

    Zabbix HTTP Agent API Call

    0

    I have just recently installed Zabbix 4.2.1 on a standalone RHEL 7 VM and working with a Jenkins Server on a Windows 10 VM. In short, I was able to successfully install Zabbix and run a Zabbix Agent on the Windows environment. Currently, I am able to pull all the server metrics into the Zabbix dashboard and display it.

    My question is now I am trying to set up Zabbix dashboard to display the metrics from Jenkins (ie. job count, success and build failures, etc.). I came across this plug-in that exposes an API that I can make a GET request within Zabbix to pull these metrics.

    In trying to set up the HTTP agent within Zabbix I am currently getting this error:
    Response code "404" did not match any of the required status codes "200"
    I have been worked through multiple different errors and realize I don't have something configured correctly.

    One of those originally being that Zabbix "cannot resolve host" so added it to /etc/hosts.

    After looking back at the Zabbix documentation (following example #4) I am currently configured like so:
    Name: Jenkins-Metrics Type HTTP agent Key: jenkins_metrics URL: http://<my_url:Port>/metrics/<unique_key>/metrics/ Request type: GET HTTP authentication: Basic User name: userName Password: password
    Now I have checked the URL and able to see the JSON object I am trying to call.

    I have also been successful at calling this JSON object on the Linux server via command line:
    curl --user "userNameassword" --request GET http://<my_url:Port>/metrics/<unique_key>/metrics/
    I have also tried to request a GET request without authentication and get "access denied." Which leads me to believe I am not setting up authentication correctly within the Zabbix UI.

    Any help would be appreciated. Thanks in advance!
  • zabuser999
    Junior Member
    • Jun 2019
    • 2

    #2
    i am newbie too,
    but I have successfully set up HTTP agent,
    initially I also came across Response code "404" did not match any of the required status codes "200".
    I resolved this by adding 200, 404 in Required status codes.
    I am not sure if this was the issue you are facing.

    Comment

    Working...